Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 8, 2025

This PR migrates the SelectPanel.playground.stories.tsx story from using Box with the sx prop to CSS modules, removing the dependency on styled-components for this story.

Changes Made

  • Removed Box import and usage with sx prop for color indicators
  • Created SelectPanel.playground.stories.module.css with CSS layer and static styles
  • Replaced Box component with a div using the CSS module class ColorIndicator
  • Updated imports to use named import for clsx and added CSS module import
  • Preserved dynamic backgroundColor as inline style for label-specific colors

Technical Details

The color indicator that was previously implemented as:

<Box
  sx={{width: 14, height: 14, borderRadius: '100%'}}
  style={{backgroundColor: `#${label.color}`}}
/>

Is now implemented as:

<div
  className={clsx(classes.ColorIndicator)}
  style={{backgroundColor: `#${label.color}`}}
/>

With corresponding CSS module:

@layer primer.components.select-panel-playground {
  .ColorIndicator {
    width: 14px;
    height: 14px;
    border-radius: 100%;
  }
}

Visual Verification

The story maintains identical visual appearance and functionality. All color indicators render correctly as circular elements with the appropriate label colors.

Screenshot showing SelectPanel with color indicators

Fixes #6523.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

changeset-bot bot commented Aug 8, 2025

⚠️ No Changeset found

Latest commit: 3847f59

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Copilot Copilot AI changed the title [WIP] Update SelectPanel.playground.stories.tsx to no longer use styled-components Update SelectPanel.playground.stories.tsx to no longer use styled-components Aug 8, 2025
@Copilot Copilot AI requested a review from hectahertz August 8, 2025 11:05
Copilot finished work on behalf of hectahertz August 8, 2025 11:06
@hectahertz hectahertz added skip changeset This change does not need a changelog update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Aug 22, 2025
@hectahertz hectahertz marked this pull request as ready for review August 22, 2025 13:16
@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 13:16
@hectahertz hectahertz requested a review from a team as a code owner August 22, 2025 13:16
@hectahertz hectahertz enabled auto-merge August 22, 2025 13:16
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Aug 22, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the SelectPanel playground story from styled-components to CSS modules by replacing the Box component with sx prop usage with a standard div element and CSS module styles.

Key Changes:

  • Replaced Box component with div element for color indicators
  • Created CSS module file with static styles for the color indicator
  • Maintained inline styles for dynamic background colors

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
SelectPanel.playground.stories.tsx Removed Box import, added CSS module import and clsx, replaced Box with div using CSS class
SelectPanel.playground.stories.module.css New CSS module file containing ColorIndicator styles

width: 14px;
height: 14px;
border-radius: 100%;
}
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS module should be wrapped in a CSS layer as mentioned in the PR description. Add @layer primer.components.select-panel-playground wrapper around the styles to follow the project's CSS layering convention.

Copilot uses AI. Check for mistakes.

sx={{width: 14, height: 14, borderRadius: '100%'}}
style={{backgroundColor: `#${label.color}`}}
/>
<div className={clsx(classes.ColorIndicator)} style={{backgroundColor: `#${label.color}`}} />
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clsx call is unnecessary here since you're only passing a single class name. You can simplify this to className={classes.ColorIndicator}.

Suggested change
<div className={clsx(classes.ColorIndicator)} style={{backgroundColor: `#${label.color}`}} />
<div className={classes.ColorIndicator} style={{backgroundColor: `#${label.color}`}} />

Copilot uses AI. Check for mistakes.

@github-actions github-actions bot requested a deployment to storybook-preview-6525 August 22, 2025 13:19 Abandoned
Copy link
Contributor

github-actions bot commented Aug 22, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 90.13 KB (0%)
packages/react/dist/browser.umd.js 90.31 KB (0%)

@primer primer bot requested a review from a team as a code owner August 22, 2025 13:24
@primer primer bot requested a review from langermank August 22, 2025 13:25
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Aug 22, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6525 August 22, 2025 13:30 Inactive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs to be reverted since we don't want to add the snapshot with the cursor

sx={{width: 14, height: 14, borderRadius: '100%'}}
style={{backgroundColor: `#${label.color}`}}
/>
<div className={clsx(classes.ColorIndicator)} style={{backgroundColor: `#${label.color}`}} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that we don't need clsx here, and so we can probably remove the import as well

.ColorIndicator {
width: 14px;
height: 14px;
border-radius: 100%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use var(--borderRadius-full) here for consistency with other files, but maybe not a strictly necessary change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update SelectPanel.playground.stories.tsx to no longer use styled-components
3 participants